﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using RoadTeam.Model.BS;
using RoadTeam.Model;
using RoadTeam.Enums;
using RoadTeam.SysInterface;

namespace RoadTeam.BsSystem.PC
{
    public class PcDict_Sys : IPcDict
    {
        public DataTable GetDict(String DictType)
        {
            SqlWhere where = new SqlWhere();
            where.Info = new TbPcDict() { DictTypeCode = DictType, Status = "Y" };
            where.SelectColumn = @"DictID,DictCode,DictName,DictTypeCode,App_Identifier";
            return TbPcDict.Select(where, GlobalConfig.RtConnectionString);
        }
        public DataTable GetDictIdentifierNull(String DictType)
        {
            SqlWhere where = new SqlWhere();
            where.Info = new TbPcDict() { DictTypeCode = DictType, Status = "Y" };
            where.SelectColumn = @"DictID,DictCode,DictName,DictTypeCode,App_Identifier";
            where.StrSqlWhere = @" App_Identifier Is NULL ";
            return TbPcDict.Select(where, GlobalConfig.RtConnectionString);
        }

        public DataTable GetDictIdentifierNotNull(String DictType)
        {
            SqlWhere where = new SqlWhere();
            where.Info = new TbPcDict() { DictTypeCode = DictType, Status = "Y" };
            where.SelectColumn = @"DictID,DictCode,DictName,DictTypeCode,App_Identifier";
            where.StrSqlWhere = @" App_Identifier Is Not  NULL ";
            return TbPcDict.Select(where, GlobalConfig.RtConnectionString);
        }

        public bool Update(DataTable dt)
        {
           return  TbPcDict.Update(dt, GlobalConfig.RtConnectionString);
        }




    }
}
